package com.jubaozan.c3.common;

/**
 * @author yuanjie
 */
public class ResultBuilder {
    private static <T> ResultVO<T> build(int status, String message, T body, String description) {
        ResultVO<T> result = new ResultVO<>();
        result.setBody(body);
        result.setStatus(status);
        result.setMessage(message);
        result.setDescription(description);
        return result;
    }

    public static <T> ResultVO<T> success(T body) {
        return build(0, "succeed", body, null);
    }

    public static <T> ResultVO<T> error(int status, String message) {
        return build(status, message, null, null);
    }
}
